package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 第三方劵同步
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_third_party_sync")
public class ThirdPartySync extends Model<ThirdPartySync> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "event", type = IdType.ASSIGN_ID)
    private String event;
    /**
     * 优惠金额
     */
    @TableField("discount_amount")
    private BigDecimal discountAmount;
    /**
     * 券的总数量
     */
    @TableField("total_quantity")
    private Long totalQuantity;
    /**
     * 已使用数量
     */
    @TableField("use_quantity")
    private Long useQuantity;
    /**
     * 同步时间
     */
    @TableField("sync_time")
    private LocalDateTime syncTime;
    /**
     * 第三方券商
     */
    @TableField("third_party")
    private String thirdParty;
    /**
     * 操作人
     */
    @TableField("operator")
    private String operator;
    /**
     * 机构ID
     */
    @TableField("org_id")
    private String orgId;

    public void freeData() {
        this.event = null;
        this.discountAmount = null;
        this.totalQuantity = null;
        this.useQuantity = null;
        this.syncTime = null;
        this.thirdParty = null;
        this.operator = null;
        this.orgId = null;
    }

}
